package com.example.nonacademic_education.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AdminAuthorityDao {
    @Select("select authority_id from admin_authority where admin_id=#{adminId}")
    List<Long> findByAdminId(Long adminId);

    Integer addAuthority(Long adminId, List<Long> needAdd);

    Integer deleteAuthority(Long adminId, List<Long> needDelete);

    @Delete("delete from admin_authority where admin_id=#{id}")
    Integer deleteByAdminId(Long id);
    @Select("select aa.authority_id from admin_authority aa left join admin a on a.id = aa.admin_id where a.username=#{loginId}")
    List<Long> getIdsByUsername(Object loginId);
}
